#ifndef FTINTERFACE_H
#define FTINTERFACE_H

#ifdef __Win32__
#pragma warning(disable:4786)
#endif

#include <string>
#include "OSThread.h"
#include "TCPSocket.h"
#include "OSMutex.h"

class CFTInterface : public OSTask
{
public:
    ~CFTInterface();

	static CFTInterface *GetInstance();
	static	Bool	DelInstance();

	virtual Bool Initialize();
	virtual Bool Run();
//	virtual Bool Destroy();

	//send data
	Bool SendData(char *vStr,UInt32 vLen,Bool vGetBack = TRUE);
	Bool RecvData(char *vStr,UInt32 vLen,UInt32 &vOutLen,UInt32 vTimeout = 300);

protected:
    CFTInterface();
protected:
	static CFTInterface	*m_Inst;
	TCPSocket				m_Socket;

	std::string				m_Host;
	UInt16					m_Port;

	char *					m_pBuffer;

	OSMutex				m_Mutex;

	UInt32					m_ID;
};

#endif
